package com.ey12.service;


import java.util.List;

import com.ey12.db.dao.GmExchangeDAO;
import com.ey12.db.domain.GmExchange;

public class GmExchangeService {
	private GmExchangeDAO gmExchangeDAO;

	public GmExchangeDAO getGmExchangeDAO() {
		return gmExchangeDAO;
	}

	public void setGmExchangeDAO(GmExchangeDAO gmExchangeDAO) {
		this.gmExchangeDAO = gmExchangeDAO;
	}
	public List getgradeList(){
		List list = gmExchangeDAO.findAll();
		if(list.size()>0){
			return list;
		}
		return null;
	}
	public void delGrade(GmExchange gm){
		gmExchangeDAO.delete(gm);
	}
	public void updateGrade(GmExchange gm){
		gmExchangeDAO.saveOrUpdate(gm);
	}
	public void addNewGrade(GmExchange gm){
		gm.setId(null);
		gmExchangeDAO.saveOrUpdate(gm);
	}
	public GmExchange getChangeFun(){
		GmExchange gm=new GmExchange();
		List list = gmExchangeDAO.findAll();
		if(list.size()>0){
			gm=(GmExchange)list.get(0);
			return gm;
		}
		return null;	
	}
}
